package com.rightsidetech.system.mapper;

import com.rightsidetech.system.dtos.request.SysStoreIdReq;
import com.rightsidetech.system.dtos.request.SysStoreStorkPageReq;
import com.rightsidetech.system.dtos.request.store.SysAgentStorkPageReq;
import com.rightsidetech.system.dtos.response.*;
import com.rightsidetech.system.dtos.response.store.HomeStoreStorkResp;
import com.rightsidetech.system.dtos.response.store.StoreStorkResp;
import com.rightsidetech.system.dtos.response.store.SysAgentStorkPageResp;
import com.rightsidetech.system.entity.SysStoreStock;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysStoreStockMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysStoreStock record);

    int insertSelective(SysStoreStock record);

    SysStoreStock selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysStoreStock record);

    int updateByPrimaryKey(SysStoreStock record);

    List<SysStoreStorkPageResp> page(SysStoreStorkPageReq req);

    List<SysStoreStorkInfoResp> selectReplenishInfo(SysStoreIdReq req);

    List<SysStoreStorkAppResp> listAll(@Param("storeId") Long storeId);

    List<HomeStoreStorkResp> selectOutofStockByAgentId(@Param("agentInfoId") Long agentInfoId,@Param("warnNumber") Long warnNumber);

    List<SysAgentStorkPageResp> pageAgent(@Param("req") SysAgentStorkPageReq req,@Param("agentInfoId") Long agentInfoId);

    List<SysStoreStorkInfoResp> selectAgentReplenishInfo(@Param("req")SysStoreIdReq req,@Param("agentInfoId") Long agentInfoId);

    List<StoreStorkResp> findByStorkAgentInfoId(@Param("sysAgentInfoId") Long sysAgentInfoId, @Param("storeName") String storeName);

    int selectByStoreId(Long id);

    SysStoreStock selectBySpecsId(@Param("storeId")Long storeId,@Param("specsId")Long specsId);

    SysStoreStock selectNoneSpecsByCommodityId(@Param("storeId")Long storeId,@Param("commodityId")Long commodityId);

    SysStoreStock selectBySecsComm(@Param("storeId")Long storeId,@Param("specsId")Long specsId,@Param("commodityId") Long commodityId);

    int updateStorkNum(@Param("storeId")Long storeId,@Param("specsId")Long specsId,@Param("num") Long num);

    int updateStorkExpiredNum(@Param("storeId")Long storeId,@Param("specsId")Long specsId,@Param("expiredNum") Long expiredNum);

    int updateStorkNumBySpecsId(@Param("storeId")Long storeId,@Param("specsId")Long specsId,@Param("commodityId") Long commodityId,@Param("num") Long num,@Param("expiredNum") Long expiredNum);

    int updateDel(Long id);

    int updateStorkNumById(@Param("id")Long id,@Param("num")Long num);

    Long findStoreCurrentStock(@Param("storeId") Long storeId);

    int selectCountCommodityIdByStoreId(@Param("storeId") Long storeId);

    List<SysStoreStorkDetailsAppResp> selectList(@Param("storeId") Long storeId);

    List<Long> selectCommoditySpecsIdByStoreId(Long storeId);
}